package com.example.cvapp;

import java.util.Random;

import android.net.wifi.p2p.WifiP2pManager.ActionListener;
import android.os.Bundle;
import android.app.Activity;
import android.view.*;
import android.view.View.OnClickListener;
import android.widget.*;

public class MainActivity extends Activity implements ActionListener {

	private TextView textView;
	private Random randomGenerator ;
	private ImageButton b1;
	private static final int nrOfInfo  = 10 ;
	private String[] cvInfo = new String []{"First name: firstname ", 
											"Last name: lastName" ,
											"Age: 99",
											"Adress: Kristianstad University \n Hassleholm \n Sweden " , 
											"Telefon: 1233344 " ,
											"Email: student@hkr.edu ", 
											"Education: Software Development and Engineering ",
											"Drviving Licence: B ", 
											"Other Skills: JAVA" ,
											"Hobby: coding"};

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		
		
		textView = (TextView) findViewById(R.id.txtInfo);
		//textView.setVisibility(View.INVISIBLE);
		
		
		
		
		b1 = (ImageButton ) findViewById(R.id.btnClick);
		b1.setOnClickListener(new OnClickListener()		{
		public void onClick(View v)	{
			
			randomGenerator = new Random();
			textView.setText(cvInfo[randomGenerator.nextInt(nrOfInfo)]);
		}});
		
		return true;
		
	}

	@Override
	public void onFailure(int reason) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onSuccess() {
		// TODO Auto-generated method stub
		
	}

}
